<script setup lang="ts">
defineEmits(['update:captcha'])
const key = ref(1)
const reload = () => {
  key.value++
}
defineExpose({ reload })
</script>

<template>
  <main>
    <div class="flex gap-1">
      <HdFormInput placeholder="请输入验证码" @input="$emit('update:captcha', $event.target.value)" />
      <!-- <el-input placeholder="请输入验证码" size="large" clearable /> -->
      <el-image :src="`/api/captcha?` + key" fit="fill" class="rounded-md border cursor-pointer" @click="key++" />
    </div>
    <HdError name="captcha" />
  </main>
</template>
<style lang="scss" scoped></style>
